package cc.iotkit.data.model;

import cc.iotkit.model.alert.AlertFence;
import cc.iotkit.model.alert.AlertRecord;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Entity
@Table(name = "alert_fence")
@AutoMapper(target = AlertFence.class)
@DynamicUpdate
@DynamicInsert
public class TbAlertFence {

    @Id
    @GeneratedValue(generator = "SnowflakeIdGenerator")
    @GenericGenerator(name = "SnowflakeIdGenerator", strategy = "cc.iotkit.data.config.id.SnowflakeIdGenerator")
    @ApiModelProperty(value = "id")
    private Long id;
    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    private Long tenantId;
    /**
     * 设备id
     */
    @ApiModelProperty(value = "设备id")
    private String deviceId;

    @ApiModelProperty(value = "坐标,格式：x,y")
    private String location;

    @ApiModelProperty(value = "创建日期")
    private LocalDateTime createAt;

    @ApiModelProperty(value = "地理围栏id")
    private Integer gfid;

    @ApiModelProperty(value = "地理围栏名称")
    private String gfname;
}
